Day’s objectives
- Understand workflow, why it is important, and how to do it using Rstudio/R
- Have an understanding of the tidyverse framework and its key packages
- Work through an example
Key packages

Example of some workflows
mine
Paul’s
Commonalities
Advantages of workflow
asfd
adsf
Dataset for workshop
For this workshop, we will you an example dataset to go through the whole workflow process.
Rstudio
You can find a variety of cheatsheets at https://posit.co/resources/cheatsheets/
Basics
- assume familiar with
- might want to turn off .Rdata so everything is fresh on startup (no issues with previous objects so completely reproducible)
Tips and tricks
- tab
- fills in paths
- hexcode color coating
- code folding (#)
- insert pipe: ctrl+shift+M %>%
- comment: ctrl + shift + C
- find in all files
Programming good technique
- consistent style
- modularize your code (functions - slightly more advanced)
Tidyverse framework

Historical context
quirky things about R: factors vs character, NAs,
tibble is data.frame v2.0
- better printing of the data
- handles some of the quirky things that caught up people
- column names
lubridate fixed date quirks
Importing
Saving the data files
At the end of the import and clean stage, I save the dataset as a
Excel files

CSV/Table

Joins

knitr::include_graphics(“dplyr.pdf”)
Note: joins = merges (synonyms)
Tips and tricks
- Essential to make sure that the number of rows out matches your expectation
- Almost all my joins are
Restructuring

knitr::include_graphics(“tidyr.pdf”)
String manipulation

knitr::include_graphics(“stringr.pdf”)
Date/time

Saving the clean data
At the end of the import and clean stage, I save the dataset as a